home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / cp1.zip / BORL2ZIP.C2 < prev    next >
Text File  |  1993-05-12  |  3KB  |  98 lines

  1. ===========================================================================
  2.  BBS: The Abacus * HST/DS * Potterville MI
  3. Date: 05-08-93 (02:30)             Number: 34
  4. From: RICARDO GUIMARAES            Refer#: NONE
  5.   To: DAVE GOMBOC                   Recvd: NO  
  6. Subj: BORL2ZIP.C - 2 OF 2            Conf: (36) C Language
  7. ---------------------------------------------------------------------------
  8. /* Part 2 of BORL2ZIP.C */
  9.  
  10.                 while( !feof(Source) && !ferror(Source)){
  11.                         size = fread(buffer,1,BUFSIZE,Source);
  12.                         fwrite(buffer,1,size,NewFile);
  13.                         if (ferror(NewFile)){
  14.                                 printf("Error writing %s\n",oname);
  15.                                 exit(1);
  16.                         }
  17.                 }
  18.                 if ( ferror(Source) && !feof(Source) ){
  19.                         printf("Error reading file %s\n",iname);
  20.                         exit(1);
  21.                 }
  22.                 fclose(Source);
  23.                 if ( GetMore() ){
  24.                         strcpy(iname,argv[1]);
  25.                         strcat(iname,".CA");
  26.                         strcat(iname,itoa(++counter,str,16));
  27.                 }
  28.                 else
  29.                         done=1;
  30.         }
  31.         fclose(NewFile);
  32.         free(buffer);
  33.         printf("Done...                                   \n");
  34.         return (0);
  35. }
  36.  
  37. int GetMore(void)
  38. {
  39.         int x,y;
  40.         char c;
  41.         /* clear keyboard buffer */
  42.         while ( kbhit() )
  43.                 getch();
  44.  
  45.         y=wherey();
  46.  
  47.         gotoxy(1,y);
  48.         printf("Should I get [A]nother file or [E]nd? [A]");
  49.         x = wherex()-2;
  50.         do {
  51.                 gotoxy(x,y);
  52.                 c = toupper(getch());
  53.         } while ( c!='A' && c!='E' && c!='\r' );
  54.         c = (c=='\r') ? 'A' : c ;
  55.         putchar(c);
  56.         gotoxy(1,y);
  57.         if ( c=='A' )
  58.                 return (1);
  59.         else
  60.                 return (0);
  61. }
  62.  
  63. int QuitNow(void)
  64. {
  65.         int x,y;
  66.         char c;
  67.         /* clear keyboard buffer */
  68.         while ( kbhit() )
  69.                 getch();
  70.  
  71.         y=wherey();
  72.  
  73.         gotoxy(1,y);
  74.         printf("File not found! [R]etry or [Q]uit? [R]");
  75.         x = wherex()-2;
  76.         do {
  77.                 gotoxy(x,y);
  78.                 c = toupper(getch());
  79.         } while ( c!='R' && c!='Q' && c!='\r' );
  80.         c = (c=='\r') ? 'R' : c ;
  81.         putchar(c);
  82.         gotoxy(1,y);
  83.         if ( c=='Q' )
  84.                 return (1);
  85.         else
  86.                 return (0);
  87. }
  88.  
  89.  
  90.  * SLMR 2.1a * Nam Sybillam quidem cumis... vidi in ampulla pendere.
  91.  
  92.  
  93. --- WM v2.07/91-0165
  94.  * Origin: TrailBlaZer BBS HST * 201-742-1860 Paterson, NJ  (1:107/48)
  95. SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
  96. SEEN-BY: 153/752 154/40 77 157/2 159/100 125 575 950 203/23 209/209 261/1023
  97. SEEN-BY: 280/1 390/1 396/1 5 15 2270/1 2440/5 3603/20
  98.